import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;
public class Project extends JFrame implements ActionListener {
	JPanel my_panel;
	JButton my_button;
	JLabel my_label;
	JButton my_button1;
	JPanel my_panel1;
	JColorChooser my_color;
	JScrollBar my_scroll;
	JTextField my_text;
	
	
	public Project(){
		setTitle("hai"); // set the name of the frame
		setSize(600,500); // set the size of the frame
		setDefaultCloseOperation(EXIT_ON_CLOSE); // to make the frame can be closed
		setUpPanel();
		this.add(my_panel);
		
	}
	
	public void setUpPanel(){
		BorderLayout layout = new BorderLayout();
		my_panel = new JPanel();
		my_panel.setLayout(layout);
		my_panel1 = new JPanel();
		my_color = new JColorChooser();
		my_panel1.add(my_color);
		my_scroll = new JScrollBar();
		my_panel1.add(my_scroll);
		my_text = new JTextField(20);
		my_panel1.add(my_text);
		
		
		
		my_button = new JButton("click me");
		my_button1 = new JButton("dont click me");
		my_button.addActionListener(this);
		my_label =  new JLabel("im a label");
		my_panel1.add(my_button);
		my_panel.add(my_label,layout.NORTH);
		my_panel1.add(my_button1);
		my_panel.add(my_panel1,layout.CENTER);
		
	
	}
	
	
	public static void main(String[] args) {
		Project project = new Project(); // call the project class
		project.setVisible(true);
		
		
		

	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		my_text.setText("hai, im fadhil"); 
		String my_text = my_button.getText();
		
	}

}
